package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.junit.Test;

import java.util.List;

public class UserController {
    //创建业务层对象
    private UserService service=new UserServiceImpl();



    @Test
    public void findAll(){
      List<User>users = service.findAll();
        for (User u : users) {
            System.out.println(u);
        }
    }


    @Test
    public void findById(){
        User u=service.findById(2);
        System.out.println(u);
    }


    @Test
    public void add(){
        User u=new User();
        int result = service.add(u);
        System.out.println(result);
    }


    @Test
    public void findByIdOrName(){
       User u=new User();
        List<User>users =service.findByIdOrName(1,"钟文泽");
    }

    @Test
    public void delete(){
        Integer result=service.delete(4);
        System.out.println(result);

    }

    @Test
    public void update(){



    }



}
